<?php
	require "settings/config.php";
	require "layout.php";
	require "includes/session.php";
	require "includes/sql_functions.php";
	require "includes/slot_functions.php";
	
	oh_require_admin();
	
	render_header("Editing Game Slot");
	
	if($_GET['code'] != "")
	{
		$date=oh_get_slot_time($_GET['code']);
	}
	else
	{
		echo "No slot specified";
		die(); 
	}
	
	if($_GET['baddate']==1)
	echo "Invalid date entered.";
	
?>
	
	<div style="display:inline-block;vertical-align:top;padding:0.5em">
	<b>Editing slot:</b>
	<br />
	<form action="do_slotedit.php" method="POST">
	<input type="hidden" name="slot" value="<?php echo $_GET['code']; ?>">	
	
	Year - Month - Day:<br />	
	<input type="text" name="year" size="4" class="inputbox" value="<?php echo $date->format(Y); ?>">-<input type="text" name="month" size="2" class="inputbox" value="<?php echo $date->format(m); ?>">-<input type="text" name="day" size="2" class="inputbox" value="<?php echo $date->format(d); ?>"><br />
	
	Start Hour : Minute <span class="smalltext">(24 hour)</span>: <br />
	<input type="text" name="hour" size="2" class="inputbox" value="<?php echo $date->format(H); ?>">:<input type="text" name="minute" size="2" class="inputbox" value="<?php echo $date->format(i); ?>"> <br />
	
	Duration <span class="smalltext">(hours)</span>  <br /> 
	<input type="text" name="duration" size="2" value="<?php echo $date->format(s);?>" class="inputbox"><br />
	
	<span class="smalltext">Note: For games which will span multiple timeslots,</br>
	consider creating a multi-slot game rather than an extended timeslot.</span>
	<br />	
	<input type="submit" class="button" value="Save Changes">
	</form>
<?php
	render_footer();
?>